﻿<phone:PhoneApplicationPage 
    x:Class="YAPIExample.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    shell:SystemTray.IsVisible="True">

    <Grid x:Name="LayoutRoot">
        <Grid.Background>
            <ImageBrush Stretch="Fill" ImageSource="/Background.png">
            </ImageBrush>
        </Grid.Background>
        <Grid.RowDefinitions>
            <RowDefinition Height="auto"/>
            <RowDefinition Height="*"/>
            <RowDefinition Height="50"/>
        </Grid.RowDefinitions>
        <ProgressBar Grid.Row="1" x:Name="pro" IsIndeterminate="True" Foreground="White" Background="White"></ProgressBar>

        <Grid x:Name="header" Background="#99000000">
            <Image Grid.Row="0" HorizontalAlignment="Left" Height="80" Width="80" Stretch="Fill" Margin="10,0,20,0" Source="/ApplicationIcon.png"/>
            <TextBlock Grid.Row="0" Text="MTH Youtube" FontSize="40" Foreground="#FFFF5100" Margin="100,0,0,0" VerticalAlignment="Center" TextTrimming="WordEllipsis"/>
            <CheckBox x:Name="HD" Grid.Row="0" Content="HD" HorizontalAlignment="Right" FontSize="20" Tap="HD_Tap_1" Margin="0"/>
        </Grid>
        <ListBox x:Name="itemsCollection" Grid.Row="1">
            <ListBox.ItemTemplate>
                <DataTemplate>
                    <Grid Height="100" Tap="video_Tap_1" Margin="5,10,5,0" Width="{Binding ElementName=itemsCollection, Path=ActualWidth}" Background="#AA000000">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="140"/>
                            <ColumnDefinition Width="*"/>
                        </Grid.ColumnDefinitions>
                        <Image Grid.Column="0" Margin="10" Stretch="Fill" Source="{Binding thumb}" Width="120" HorizontalAlignment="Left"/>
                        <Grid Grid.Column="1">
                            <TextBlock Height="60" Text="{Binding title}" Foreground="#FF00B0F0" FontSize="25" VerticalAlignment="Top" TextTrimming="WordEllipsis" Margin="0,0,10,0"/>
                            <TextBlock Text="{Binding times}" Margin="0,0,0,10" HorizontalAlignment="Left" VerticalAlignment="Bottom" Foreground="White"/>
                            <TextBlock Text="{Binding views}" Margin="0,0,12,10" HorizontalAlignment="Right" VerticalAlignment="Bottom" Foreground="White"/>
                        </Grid>
                    </Grid>
                </DataTemplate>
            </ListBox.ItemTemplate>
        </ListBox>

        <Grid x:Name="about" Tap="about_Tap" Grid.Row="1" Margin="20" Background="#DD000000">
            <TextBlock Margin="20,50,0,0">
                <Run>***********************************************</Run>
                <LineBreak/>
                <Run>**************** YAPI Example ***************</Run>
                <LineBreak/>
                <Run>***********************************************</Run>
                <LineBreak/>
                <Run>Mai Trung Hieu</Run>
                <LineBreak/>
                <Run>University of Information Technology</Run>
                <LineBreak/>
                <Run>MSP in Microsoft Vietnam</Run>
                <LineBreak/>
                <Run>Email: maitrunghieuit@hotmail.com</Run>
                <LineBreak/>
                <Run>Phone: (+84)902996889 or (+84)1653399789</Run>
            </TextBlock>
            <Button Height="100" VerticalAlignment="Bottom" Content="Hope to be friend on Facebook" Background="#FF22A88A" Tap="fb_Tap_1"></Button>
        </Grid>
        
        <Grid Grid.Row="2" Background="Black">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="80"/>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="80"/>
            </Grid.ColumnDefinitions>
            <Image x:Name="prePage" Grid.Column="0" Tap="prePage_Tap" Visibility="Collapsed" Source="/back.png"/>
            <Image x:Name="nextPage" Grid.Column="2" Tap="nextPage_Tap" Source="/next.png"/>
        </Grid>

    </Grid>
 
</phone:PhoneApplicationPage>